GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
- gint border_width;
+ guint border_width;
GtkRequisition child_requisition;
gtk_widget_set_realized (widget, TRUE);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
GtkRequisition child_requisition;
double s, c;
double w, h;
+ guint border_width;
child_requisition.width = 0;
child_requisition.height = 0;
w = c * child_requisition.width + s * child_requisition.height;
h = s * child_requisition.width + c * child_requisition.height;
- requisition->width = GTK_CONTAINER (widget)->border_width * 2 + w;
- requisition->height = GTK_CONTAINER (widget)->border_width * 2 + h;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = border_width * 2 + w;
+ requisition->height = border_width * 2 + h;
}
static void
GtkAllocation *allocation)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
- gint border_width;
+ guint border_width;
gint w, h;
gdouble s, c;
widget->allocation = *allocation;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
- gint border_width;
+ guint border_width;
GtkRequisition child_requisition;
gtk_widget_set_realized (widget, TRUE);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GtkRequisition child_requisition;
+ guint border_width;
child_requisition.width = 0;
child_requisition.height = 0;
if (bin->child && gtk_widget_get_visible (bin->child))
gtk_widget_size_request (bin->child, &child_requisition);
- requisition->width = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.width + 10;
- requisition->height = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.height * 2 + 10;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = border_width * 2 + child_requisition.width + 10;
+ requisition->height = border_width * 2 + child_requisition.height * 2 + 10;
}
static void
GtkAllocation *allocation)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
- gint border_width;
gint w, h;
+ guint border_width;
+
widget->allocation = *allocation;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
GtkBin *bin;
GtkAllocation child_allocation;
gint width, height;
- gint border_width;
+ guint border_width;
gint padding_horizontal, padding_vertical;
GtkAlignmentPrivate *priv;
gint child_nat_height;
gint child_width, child_height;
- border_width = GTK_CONTAINER (alignment)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (alignment));
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
padding_horizontal = priv->padding_left + priv->padding_right;
{
GtkWidget *child;
GtkAlignmentPrivate *priv;
- gint minimum, natural;
+ guint minimum, natural;
priv = GTK_ALIGNMENT_GET_PRIVATE (widget);
- natural = minimum = GTK_CONTAINER (widget)->border_width * 2;
+ natural = minimum = gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2;
if ((child = gtk_bin_get_child (GTK_BIN (widget))) && gtk_widget_get_visible (child))
{
GtkRequisition child_requisition;
gint header_padding, content_padding;
gint width, height, header_width, header_height;
+ guint border_width;
GList *list;
gtk_widget_style_get (widget,
width = MAX (width, child_requisition.width);
height += child_requisition.height + ACTION_AREA_SPACING;
- width += GTK_CONTAINER (widget)->border_width * 2 + content_padding * 2;
- height += GTK_CONTAINER (widget)->border_width * 2 + content_padding * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ width += border_width * 2 + content_padding * 2;
+ height += border_width * 2 + content_padding * 2;
requisition->width = width;
requisition->height = height;
GtkRequisition header_requisition, action_requisition, sidebar_requisition;
GtkAllocation child_allocation, header_allocation;
gint header_padding, content_padding;
+ guint border_width;
gboolean rtl;
GList *pages;
NULL);
widget->allocation = *allocation;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
/* Header */
gtk_widget_get_child_requisition (priv->header_image, &header_requisition);
- header_allocation.x = GTK_CONTAINER (widget)->border_width + header_padding;
- header_allocation.y = GTK_CONTAINER (widget)->border_width + header_padding;
- header_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * header_padding;
+ header_allocation.x = border_width + header_padding;
+ header_allocation.y = border_width + header_padding;
+ header_allocation.width = allocation->width - 2 * border_width - 2 * header_padding;
header_allocation.height = header_requisition.height;
gtk_widget_size_allocate (priv->header_image, &header_allocation);
/* Action area */
gtk_widget_get_child_requisition (priv->action_area, &action_requisition);
- child_allocation.x = GTK_CONTAINER (widget)->border_width;
- child_allocation.y = allocation->height -
- GTK_CONTAINER (widget)->border_width - action_requisition.height;
- child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width;
+ child_allocation.x = border_width;
+ child_allocation.y = allocation->height - border_width - action_requisition.height;
+ child_allocation.width = allocation->width - 2 * border_width;
child_allocation.height = action_requisition.height;
gtk_widget_size_allocate (priv->action_area, &child_allocation);
gtk_widget_get_child_requisition (priv->sidebar_image, &sidebar_requisition);
if (rtl)
- child_allocation.x = allocation->width -
- GTK_CONTAINER (widget)->border_width - sidebar_requisition.width;
+ child_allocation.x = allocation->width - border_width - sidebar_requisition.width;
else
- child_allocation.x = GTK_CONTAINER (widget)->border_width;
+ child_allocation.x = border_width;
- child_allocation.y = GTK_CONTAINER (widget)->border_width +
- priv->header_image->allocation.height + 2 * header_padding;
+ child_allocation.y = border_width + priv->header_image->allocation.height + 2 * header_padding;
child_allocation.width = sidebar_requisition.width;
- child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
+ child_allocation.height = allocation->height - 2 * border_width -
priv->header_image->allocation.height - 2 * header_padding - priv->action_area->allocation.height;
gtk_widget_size_allocate (priv->sidebar_image, &child_allocation);
/* Pages */
- child_allocation.x = GTK_CONTAINER (widget)->border_width + content_padding;
- child_allocation.y = GTK_CONTAINER (widget)->border_width +
+ child_allocation.x = border_width + content_padding;
+ child_allocation.y = border_width +
priv->header_image->allocation.height + 2 * header_padding + content_padding;
- child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * content_padding;
- child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
+ child_allocation.width = allocation->width - 2 * border_width - 2 * content_padding;
+ child_allocation.height = allocation->height - 2 * border_width -
priv->header_image->allocation.height - 2 * header_padding - ACTION_AREA_SPACING - priv->action_area->allocation.height - 2 * content_padding;
if (gtk_widget_get_visible (priv->sidebar_image))
priv = GTK_ASSISTANT (widget)->priv;
/* we only have to care about 2 widgets, action area and the current page */
- if (container->focus_child == priv->action_area)
+ if (gtk_container_get_focus_child (container) == priv->action_area)
{
if (!gtk_widget_child_focus (priv->action_area, direction) &&
(priv->current_page == NULL ||
gtk_button_box_get_child_secondary (GtkButtonBox *widget,
GtkWidget *child)
{
- GtkBoxChild *child_info;
- GList *list;
+ GtkBoxChild *child_info = NULL;
+ GList *list, *children;
g_return_val_if_fail (GTK_IS_BUTTON_BOX (widget), FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
- child_info = NULL;
- list = gtk_container_get_children (GTK_CONTAINER (widget));
+ list = children = gtk_container_get_children (GTK_CONTAINER (widget));
+
while (list)
{
child_info = list->data;
list = list->next;
}
- g_return_val_if_fail (list != NULL, FALSE);
-
- return child_info->is_secondary;
+ if (list == NULL)
+ {
+ g_list_free (children);
+ return FALSE;
+ }
+ else
+ {
+ g_list_free (children);
+ return child_info->is_secondary;
+ }
}
/**
GtkWidget *child,
gboolean is_secondary)
{
- GList *list;
-
+ GList *list, *children;
+
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (child->parent == GTK_WIDGET (widget));
- list = gtk_container_get_children (GTK_CONTAINER (widget));
+
+ list = children = gtk_container_get_children (GTK_CONTAINER (widget));
while (list)
{
GtkBoxChild *child_info = list->data;
list = list->next;
}
+ g_list_free (children);
gtk_widget_child_notify (child, "secondary");
GtkButtonBoxPriv *priv;
GtkButtonBox *bbox;
GtkBoxChild *child;
- GList *children;
+ GList *children, *list;
gint nchildren;
gint nsecondaries;
gint needed_width;
nchildren = 0;
nsecondaries = 0;
- children = gtk_container_get_children (GTK_CONTAINER (bbox));
+ list = children = gtk_container_get_children (GTK_CONTAINER (bbox));
needed_width = child_min_width;
needed_height = child_min_height;
ipad_w = ipad_x * 2;
}
}
+ g_list_free (list);
+
if (nvis_children)
*nvis_children = nchildren;
if (nvis_secondaries)
gint child_width;
gint child_height;
gint spacing;
+ guint border_width;
GtkButtonBoxStyle layout;
GtkOrientation orientation;
requisition->width = child_width;
}
- requisition->width += GTK_CONTAINER (box)->border_width * 2;
- requisition->height += GTK_CONTAINER (box)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
+ requisition->width += border_width * 2;
+ requisition->height += border_width * 2;
}
static void
GtkBox *base_box;
GtkButtonBox *box;
GtkBoxChild *child;
- GList *children;
+ GList *children, *list;
GtkAllocation child_allocation;
gint nvis_children;
gint n_secondaries;
gint childspacing = 0;
GtkButtonBoxStyle layout;
gint spacing;
+ guint border_width;
GtkOrientation orientation;
base_box = GTK_BOX (widget);
box = GTK_BUTTON_BOX (widget);
priv = box->priv;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
spacing = gtk_box_get_spacing (base_box);
layout = priv->layout_style != GTK_BUTTONBOX_DEFAULT_STYLE
widget->allocation = *allocation;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- width = allocation->width - GTK_CONTAINER (box)->border_width*2;
+ width = allocation->width - border_width*2;
else
- height = allocation->height - GTK_CONTAINER (box)->border_width*2;
+ height = allocation->height - border_width*2;
switch (layout)
{
{
childspacing = (width - (nvis_children * child_width))
/ (nvis_children + 1);
- x = allocation->x + GTK_CONTAINER (box)->border_width
- + childspacing;
+ x = allocation->x + border_width + childspacing;
secondary_x = x + ((nvis_children - n_secondaries)
* (child_width + childspacing));
}
{
childspacing = (height - (nvis_children * child_height))
/ (nvis_children + 1);
- y = allocation->y + GTK_CONTAINER (box)->border_width
- + childspacing;
+ y = allocation->y + border_width + childspacing;
secondary_y = y + ((nvis_children - n_secondaries)
* (child_height + childspacing));
}
{
childspacing = (width - (nvis_children * child_width))
/ (nvis_children - 1);
- x = allocation->x + GTK_CONTAINER (box)->border_width;
+ x = allocation->x + border_width;
secondary_x = x + ((nvis_children - n_secondaries)
* (child_width + childspacing));
}
{
childspacing = (height - (nvis_children*child_height))
/ (nvis_children-1);
- y = allocation->y + GTK_CONTAINER (box)->border_width;
+ y = allocation->y + border_width;
secondary_y = y + ((nvis_children - n_secondaries)
* (child_height + childspacing));
}
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
childspacing = spacing;
- x = allocation->x + GTK_CONTAINER (box)->border_width;
+ x = allocation->x + border_width;
secondary_x = allocation->x + allocation->width
- child_width * n_secondaries
- spacing * (n_secondaries - 1)
- - GTK_CONTAINER (box)->border_width;
+ - border_width;
}
else
{
childspacing = spacing;
- y = allocation->y + GTK_CONTAINER (box)->border_width;
+ y = allocation->y + border_width;
secondary_y = allocation->y + allocation->height
- child_height * n_secondaries
- spacing * (n_secondaries - 1)
- - GTK_CONTAINER (box)->border_width;
+ - border_width;
}
break;
x = allocation->x + allocation->width
- child_width * (nvis_children - n_secondaries)
- spacing * (nvis_children - n_secondaries - 1)
- - GTK_CONTAINER (box)->border_width;
- secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
+ - border_width;
+ secondary_x = allocation->x + border_width;
}
else
{
y = allocation->y + allocation->height
- child_height * (nvis_children - n_secondaries)
- spacing * (nvis_children - n_secondaries - 1)
- - GTK_CONTAINER (box)->border_width;
- secondary_y = allocation->y + GTK_CONTAINER (box)->border_width;
+ - border_width;
+ secondary_y = allocation->y + border_width;
}
break;
- (child_width * (nvis_children - n_secondaries)
+ spacing * (nvis_children - n_secondaries - 1))) / 2
+ (n_secondaries * child_width + n_secondaries * spacing) / 2;
- secondary_x = allocation->x + GTK_CONTAINER (box)->border_width;
+ secondary_x = allocation->x + border_width;
}
else
{
- (child_height * (nvis_children - n_secondaries)
+ spacing * (nvis_children - n_secondaries - 1))) / 2
+ (n_secondaries * child_height + n_secondaries * spacing) / 2;
- secondary_y = allocation->y + GTK_CONTAINER (box)->border_width;
+ secondary_y = allocation->y + border_width;
}
break;
childspace = child_height + childspacing;
}
- children = gtk_container_get_children (GTK_CONTAINER (box));
+ list = children = gtk_container_get_children (GTK_CONTAINER (box));
while (children)
{
gtk_widget_size_allocate (child->widget, &child_allocation);
}
}
+
+ g_list_free (list);
}
/**
if (nvis_children > 0)
{
- gint border_width = GTK_CONTAINER (box)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
GtkTextDirection direction = gtk_widget_get_direction (widget);
GtkAllocation child_allocation;
GtkBoxSpreading *spreading = g_newa (GtkBoxSpreading, nvis_children);
box = GTK_BOX (widget);
private = box->priv;
- border_width = GTK_CONTAINER (box)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
minimum = natural = 0;
gint nvis_children;
gint nexpand_children;
gint computed_minimum = 0, computed_natural = 0;
- gint border_width = GTK_CONTAINER (box)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
count_expand_children (box, &nvis_children, &nexpand_children);
gint nvis_children = 0;
gint required_size = 0, required_natural = 0, child_size, child_natural;
gint largest_child = 0, largest_natural = 0;
+ guint border_width;
- avail_size -= GTK_CONTAINER (box)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
+ avail_size -= border_width * 2;
for (children = private->children; children != NULL;
children = children->next, nvis_children++)
required_natural += (nvis_children - 1) * private->spacing;
}
- required_size += GTK_CONTAINER (box)->border_width * 2;
- required_natural += GTK_CONTAINER (box)->border_width * 2;
+ required_size += border_width * 2;
+ required_natural += border_width * 2;
if (minimum_size)
*minimum_size = required_size;
button = GTK_BUTTON (widget);
gtk_widget_set_realized (widget, TRUE);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x + border_width;
GtkButton *button = GTK_BUTTON (widget);
GtkAllocation child_allocation;
- gint border_width = GTK_CONTAINER (widget)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gint xthickness = GTK_WIDGET (widget)->style->xthickness;
gint ythickness = GTK_WIDGET (widget)->style->ythickness;
GtkBorder default_border;
if (gtk_widget_is_drawable (widget))
{
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, &interior_focus);
gtk_widget_style_get (widget,
gint focus_width;
gint focus_pad;
gint minimum, natural;
+ guint border_width;
gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-padding", &focus_pad,
NULL);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- minimum = ((GTK_CONTAINER (widget)->border_width +
+ minimum = ((border_width +
GTK_WIDGET (widget)->style->xthickness) * 2 +
inner_border.left + inner_border.right);
-
+
if (gtk_widget_get_can_default (GTK_WIDGET (widget)))
minimum += default_border.left + default_border.right;
}
else
{
- minimum = ((GTK_CONTAINER (widget)->border_width +
+ minimum = ((border_width +
GTK_WIDGET (widget)->style->ythickness) * 2 +
inner_border.top + inner_border.bottom);
NULL);
gtk_check_button_draw_indicator (check_button, area);
-
- border_width = GTK_CONTAINER (widget)->border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (gtk_widget_has_focus (widget))
{
GtkWidget *child = GTK_BIN (widget)->child;
gint temp;
gint indicator_size;
gint indicator_spacing;
- gint border_width = GTK_CONTAINER (widget)->border_width;
gint focus_width;
gint focus_pad;
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_style_get (GTK_WIDGET (widget),
"focus-line-width", &focus_width,
if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child))
{
GtkRequisition child_requisition;
- gint border_width = GTK_CONTAINER (widget)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_get_child_requisition (GTK_BIN (button)->child, &child_requisition);
gint indicator_spacing;
gint focus_width;
gint focus_pad;
+ guint border_width;
gboolean interior_focus;
widget = GTK_WIDGET (check_button);
_gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
- x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
+ x = widget->allocation.x + indicator_spacing + border_width;
y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
child = GTK_BIN (check_button)->child;
GdkRectangle restrict_area;
GdkRectangle new_area;
- restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
- restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
- restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width);
- restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width);
+ restrict_area.x = widget->allocation.x + border_width;
+ restrict_area.y = widget->allocation.y + border_width;
+ restrict_area.width = widget->allocation.width - (2 * border_width);
+ restrict_area.height = widget->allocation.height - (2 * border_width);
if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
{
if (gtk_widget_is_drawable (widget))
{
+ guint border_width;
guint offset;
guint toggle_size;
guint toggle_spacing;
NULL);
toggle_size = GTK_MENU_ITEM (check_menu_item)->toggle_size;
- offset = GTK_CONTAINER (check_menu_item)->border_width +
- widget->style->xthickness + 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ offset = border_width + widget->style->xthickness + 2;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
{
gint focus_width, focus_pad;
gint font_size;
gint arrow_size;
+ guint border_width;
GtkRequisition bin_req;
PangoContext *context;
PangoFontMetrics *metrics;
if (priv->cell_view)
{
GtkRequisition button_req, sep_req, arrow_req;
- gint border_width, xthickness, ythickness;
+ gint xthickness, ythickness;
gtk_widget_size_request (priv->button, &button_req);
- border_width = GTK_CONTAINER (combo_box)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (combo_box));
xthickness = priv->button->style->xthickness;
ythickness = priv->button->style->ythickness;
gtk_widget_size_request (priv->cell_view_frame, &frame_req);
if (priv->has_frame)
{
- requisition->width += 2 *
- (GTK_CONTAINER (priv->cell_view_frame)->border_width +
- GTK_WIDGET (priv->cell_view_frame)->style->xthickness);
- requisition->height += 2 *
- (GTK_CONTAINER (priv->cell_view_frame)->border_width +
- GTK_WIDGET (priv->cell_view_frame)->style->ythickness);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->cell_view_frame));
+
+ requisition->width += 2 * (border_width + GTK_WIDGET (priv->cell_view_frame)->style->xthickness);
+ requisition->height += 2 * (border_width + GTK_WIDGET (priv->cell_view_frame)->style->ythickness);
}
}
{
if (priv->cell_view)
{
- gint border_width, xthickness, ythickness;
+ gint xthickness, ythickness;
gint width;
+ guint border_width;
/* menu mode */
allocation->x += shadow_width;
gtk_widget_size_allocate (priv->button, allocation);
/* set some things ready */
- border_width = GTK_CONTAINER (priv->button)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->button));
xthickness = priv->button->style->xthickness;
ythickness = priv->button->style->ythickness;
/* list mode */
/* Combobox thickness + border-width */
- int delta_x = shadow_width + GTK_CONTAINER (widget)->border_width;
- int delta_y = shadow_height + GTK_CONTAINER (widget)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ int delta_x = shadow_width + border_width;
+ int delta_y = shadow_height + border_width;
/* button */
GTK_COMBO_BOX_SIZE_ALLOCATE_BUTTON
/* the sample */
if (priv->has_frame)
{
- delta_x = GTK_CONTAINER (priv->cell_view_frame)->border_width +
- GTK_WIDGET (priv->cell_view_frame)->style->xthickness;
- delta_y = GTK_CONTAINER (priv->cell_view_frame)->border_width +
- GTK_WIDGET (priv->cell_view_frame)->style->ythickness;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (priv->cell_view_frame));
+ delta_x = border_width + GTK_WIDGET (priv->cell_view_frame)->style->xthickness;
+ delta_y = border_width + GTK_WIDGET (priv->cell_view_frame)->style->ythickness;
child.x += delta_x;
child.y += delta_y;
gtk_widget_set_realized (widget, TRUE);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
GtkRequisition *requisition)
{
GtkBin *bin = GTK_BIN (widget);
+ guint border_width;
- requisition->width = GTK_CONTAINER (widget)->border_width * 2;
- requisition->height = GTK_CONTAINER (widget)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = border_width * 2;
+ requisition->height = border_width * 2;
if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkBin *bin;
GtkAllocation child_allocation;
GtkEventBoxPrivate *priv;
+ guint border_width;
widget->allocation = *allocation;
bin = GTK_BIN (widget);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (!gtk_widget_get_has_window (widget))
{
- child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
- child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width;
+ child_allocation.x = allocation->x + border_width;
+ child_allocation.y = allocation->y + border_width;
}
else
{
child_allocation.x = 0;
child_allocation.y = 0;
}
- child_allocation.width = MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0);
- child_allocation.height = MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0);
+ child_allocation.width = MAX (allocation->width - border_width * 2, 0);
+ child_allocation.height = MAX (allocation->height - border_width * 2, 0);
if (gtk_widget_get_realized (widget))
{
if (gtk_widget_get_has_window (widget))
gdk_window_move_resize (widget->window,
- allocation->x + GTK_CONTAINER (widget)->border_width,
- allocation->y + GTK_CONTAINER (widget)->border_width,
+ allocation->x + border_width,
+ allocation->y + border_width,
child_allocation.width,
child_allocation.height);
}
priv = GTK_EXPANDER (widget)->priv;
gtk_widget_set_realized (widget, TRUE);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
get_expander_bounds (GTK_EXPANDER (widget), &expander_rect);
expander = GTK_EXPANDER (widget);
priv = expander->priv;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
widget = GTK_WIDGET (expander);
priv = expander->priv;
- border_width = GTK_CONTAINER (expander)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
GtkExpanderPrivate *priv;
GtkRequisition child_requisition;
gboolean child_visible = FALSE;
- gint border_width;
+ guint border_width;
gint expander_size;
gint expander_spacing;
gboolean interior_focus;
bin = GTK_BIN (widget);
priv = expander->priv;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
int focus_pad;
int expander_size;
int expander_spacing;
+ guint border_width;
priv = expander->priv;
widget = GTK_WIDGET (expander);
"expander-spacing", &expander_spacing,
NULL);
- area.x = widget->allocation.x + container->border_width;
- area.y = widget->allocation.y + container->border_width;
- area.width = widget->allocation.width - (2 * container->border_width);
+ border_width = gtk_container_get_border_width (container);
+ area.x = widget->allocation.x + border_width;
+ area.y = widget->allocation.y + border_width;
+ area.width = widget->allocation.width - (2 * border_width);
if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
area.height = priv->label_widget->allocation.height;
widget = GTK_WIDGET (expander);
priv = expander->priv;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
{
GtkWidget *current_focus;
- current_focus = GTK_CONTAINER (expander)->focus_child;
+ current_focus = gtk_container_get_focus_child (GTK_CONTAINER (expander));
if (!current_focus)
return FALSE;
FocusSite site = FOCUS_NONE;
widget_is_focus = gtk_widget_is_focus (widget);
- old_focus_child = GTK_CONTAINER (widget)->focus_child;
+ old_focus_child = gtk_container_get_focus_child (GTK_CONTAINER (widget));
if (old_focus_child && old_focus_child == expander->priv->label_widget)
site = FOCUS_LABEL;
GtkFixedChild *child;
GList *children;
GtkRequisition child_requisition;
+ guint border_width;
fixed = GTK_FIXED (widget);
requisition->width = 0;
}
}
- requisition->height += GTK_CONTAINER (fixed)->border_width * 2;
- requisition->width += GTK_CONTAINER (fixed)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (fixed));
+ requisition->height += border_width * 2;
+ requisition->width += border_width * 2;
}
static void
GtkAllocation child_allocation;
GtkRequisition child_requisition;
GList *children;
- guint16 border_width;
+ guint border_width;
fixed = GTK_FIXED (widget);
allocation->width,
allocation->height);
}
-
- border_width = GTK_CONTAINER (fixed)->border_width;
-
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (fixed));
+
children = fixed->children;
while (children)
{
GtkAllocation *allocation = &widget->allocation;
GtkRequisition child_requisition;
gint top_margin;
+ guint border_width;
if (frame->label_widget)
{
}
else
top_margin = widget->style->ythickness;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (frame));
- child_allocation->x = (GTK_CONTAINER (frame)->border_width +
- widget->style->xthickness);
+ child_allocation->x = border_width + widget->style->xthickness;
child_allocation->width = MAX(1, (gint)allocation->width - child_allocation->x * 2);
- child_allocation->y = (GTK_CONTAINER (frame)->border_width + top_margin);
+ child_allocation->y = border_width + top_margin;
child_allocation->height = MAX (1, ((gint)allocation->height - child_allocation->y -
- (gint)GTK_CONTAINER (frame)->border_width -
+ border_width -
(gint)widget->style->ythickness));
child_allocation->x += allocation->x;
GtkBin *bin = GTK_BIN (widget);
gint child_min, child_nat;
gint minimum, natural;
+ guint border_width;
if (frame->label_widget && gtk_widget_get_visible (frame->label_widget))
{
}
}
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- minimum += (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->xthickness) * 2;
- natural += (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->xthickness) * 2;
+ minimum += (border_width + GTK_WIDGET (widget)->style->xthickness) * 2;
+ natural += (border_width + GTK_WIDGET (widget)->style->xthickness) * 2;
}
else
{
- minimum += (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->ythickness) * 2;
- natural += (GTK_CONTAINER (widget)->border_width +
- GTK_WIDGET (widget)->style->ythickness) * 2;
+ minimum += (border_width + GTK_WIDGET (widget)->style->ythickness) * 2;
+ natural += (border_width + GTK_WIDGET (widget)->style->ythickness) * 2;
}
if (minimum_size)
}
else
{
- requisition->width += GTK_CONTAINER (widget)->border_width * 2;
- requisition->height += GTK_CONTAINER (widget)->border_width * 2;
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width += border_width * 2;
+ requisition->height += border_width * 2;
if (bin->child)
{
GtkAllocation child_allocation;
guint border_width;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
child_allocation.x = border_width;
child_allocation.y = border_width;
if (child)
{
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (hb));
+
switch (handle_position)
{
case GTK_POS_LEFT:
in_handle = event->y < DRAG_HANDLE_SIZE;
break;
case GTK_POS_RIGHT:
- in_handle = event->x > 2 * GTK_CONTAINER (hb)->border_width + child->allocation.width;
+ in_handle = event->x > 2 * border_width + child->allocation.width;
break;
case GTK_POS_BOTTOM:
- in_handle = event->y > 2 * GTK_CONTAINER (hb)->border_width + child->allocation.height;
+ in_handle = event->y > 2 * border_width + child->allocation.height;
break;
default:
in_handle = FALSE;
{
gint width;
gint height;
+ guint border_width;
GtkRequisition child_requisition;
hb->child_detached = TRUE;
child_requisition.height = 0;
}
- width = child_requisition.width + 2 * GTK_CONTAINER (hb)->border_width;
- height = child_requisition.height + 2 * GTK_CONTAINER (hb)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (hb));
+ width = child_requisition.width + 2 * border_width;
+ height = child_requisition.height + 2 * border_width;
if (handle_position == GTK_POS_LEFT || handle_position == GTK_POS_RIGHT)
width += DRAG_HANDLE_SIZE;
if (pack_dir == GTK_PACK_DIRECTION_LTR ||
pack_dir == GTK_PACK_DIRECTION_RTL)
{
- offset = GTK_CONTAINER (image_menu_item)->border_width +
+ offset = gtk_container_get_border_width (GTK_CONTAINER (image_menu_item)) +
widget->style->xthickness;
if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) ==
}
else
{
- offset = GTK_CONTAINER (image_menu_item)->border_width +
+ offset = gtk_container_get_border_width (GTK_CONTAINER (image_menu_item)) +
widget->style->ythickness;
if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) ==
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gdk_window_set_user_data (widget->window, widget);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_style_get (GTK_WIDGET (menu),
"vertical-padding", &vertical_padding,
guint max_accel_width;
guint vertical_padding;
guint horizontal_padding;
+ guint border_width;
GtkRequisition child_requisition;
GtkMenuPrivate *priv;
"horizontal-padding", &horizontal_padding,
NULL);
- requisition->width += (GTK_CONTAINER (menu)->border_width + horizontal_padding +
- widget->style->xthickness) * 2;
- requisition->height += (GTK_CONTAINER (menu)->border_width + vertical_padding +
- widget->style->ythickness) * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
+ requisition->width += (border_width + horizontal_padding + widget->style->xthickness) * 2;
+ requisition->height += (border_width + vertical_padding + widget->style->ythickness) * 2;
menu->toggle_size = max_toggle_size;
GList *children;
gint x, y;
gint width, height;
+ guint border_width;
guint vertical_padding;
guint horizontal_padding;
"horizontal-padding", &horizontal_padding,
NULL);
- x = GTK_CONTAINER (menu)->border_width + widget->style->xthickness + horizontal_padding;
- y = GTK_CONTAINER (menu)->border_width + widget->style->ythickness + vertical_padding;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
+ x = border_width + widget->style->xthickness + horizontal_padding;
+ y = border_width + widget->style->ythickness + vertical_padding;
width = MAX (1, allocation->width - x * 2);
height = MAX (1, allocation->height - y * 2);
gint *arrow_space)
{
GtkWidget *widget = GTK_WIDGET (menu);
+ guint border_width;
guint vertical_padding;
guint horizontal_padding;
gint scroll_arrow_height;
"arrow-placement", &arrow_placement,
NULL);
- border->x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness + horizontal_padding;
- border->y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness + vertical_padding;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ border->x = border_width + widget->style->xthickness + horizontal_padding;
+ border->y = border_width + widget->style->ythickness + vertical_padding;
gdk_drawable_get_size (widget->window, &border->width, &border->height);
switch (arrow_placement)
GdkRectangle *lower)
{
gint width, height;
- gint border;
+ guint border;
guint vertical_padding;
gint win_x, win_y;
gint scroll_arrow_height;
"arrow-placement", &arrow_placement,
NULL);
- border = GTK_CONTAINER (menu)->border_width +
+ border = gtk_container_get_border_width (GTK_CONTAINER (menu)) +
GTK_WIDGET (menu)->style->ythickness + vertical_padding;
gdk_window_get_position (GTK_WIDGET (menu)->window, &win_x, &win_y);
double_arrows = get_double_arrows (menu);
- border_width = GTK_CONTAINER (menu)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (menu));
view_width -= (border_width + widget->style->xthickness + horizontal_padding) * 2;
view_height -= (border_width + widget->style->ythickness + vertical_padding) * 2;
menu_height = widget->requisition.height -
double_arrows = get_double_arrows (menu);
- height -= 2*GTK_CONTAINER (menu)->border_width + 2*GTK_WIDGET (menu)->style->ythickness + 2*vertical_padding;
+ height -= 2*gtk_container_get_border_width (GTK_CONTAINER (menu)) + 2*GTK_WIDGET (menu)->style->ythickness + 2*vertical_padding;
if (child_offset < y)
{
GtkContainer *container = GTK_CONTAINER (menu);
gint menu_height = (widget->allocation.height
- - 2 * (container->border_width
+ - 2 * (gtk_container_get_border_width (container)
+ widget->style->ythickness));
if (!menu->tearoff_active)
GtkWidget *widget = GTK_WIDGET (menu);
height = widget->requisition.height;
- height -= (GTK_CONTAINER (widget)->border_width + widget->style->ythickness) * 2;
+ height -= gtk_container_get_border_width (GTK_CONTAINER (widget) + widget->style->ythickness) * 2;
if (!menu->tearoff_active)
{
gint nchildren;
GtkRequisition child_requisition;
gint ipadding;
+ guint border_width;
g_return_if_fail (GTK_IS_MENU_BAR (widget));
g_return_if_fail (requisition != NULL);
}
gtk_widget_style_get (widget, "internal-padding", &ipadding, NULL);
-
- requisition->width += (GTK_CONTAINER (menu_bar)->border_width +
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (menu_bar));
+ requisition->width += (border_width +
ipadding +
BORDER_SPACING) * 2;
- requisition->height += (GTK_CONTAINER (menu_bar)->border_width +
+ requisition->height += (border_width +
ipadding +
BORDER_SPACING) * 2;
GtkTextDirection direction;
gint ltr_x, ltr_y;
gint ipadding;
+ guint border_width;
g_return_if_fail (GTK_IS_MENU_BAR (widget));
g_return_if_fail (allocation != NULL);
if (menu_shell->children)
{
- child_allocation.x = (GTK_CONTAINER (menu_bar)->border_width +
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (menu_bar));
+ child_allocation.x = (border_width +
ipadding +
BORDER_SPACING);
- child_allocation.y = (GTK_CONTAINER (menu_bar)->border_width +
+ child_allocation.y = (border_width +
BORDER_SPACING);
if (get_shadow_type (menu_bar) != GTK_SHADOW_NONE)
if (gtk_widget_is_drawable (widget))
{
- gint border;
+ guint border;
- border = GTK_CONTAINER (widget)->border_width;
+ border = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_paint_box (widget->style,
widget->window,
GtkBin *bin;
guint accel_width;
guint horizontal_padding;
+ guint border_width;
GtkPackDirection pack_dir;
GtkPackDirection child_pack_dir;
child_pack_dir = GTK_PACK_DIRECTION_LTR;
}
- requisition->width = (GTK_CONTAINER (widget)->border_width +
- widget->style->xthickness) * 2;
- requisition->height = (GTK_CONTAINER (widget)->border_width +
- widget->style->ythickness) * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = (border_width + widget->style->xthickness) * 2;
+ requisition->height = (border_width + widget->style->ythickness) * 2;
if ((pack_dir == GTK_PACK_DIRECTION_LTR || pack_dir == GTK_PACK_DIRECTION_RTL) &&
(child_pack_dir == GTK_PACK_DIRECTION_LTR || child_pack_dir == GTK_PACK_DIRECTION_RTL))
{
GtkRequisition child_requisition;
guint horizontal_padding;
+ guint border_width;
gtk_widget_style_get (widget,
"horizontal-padding", &horizontal_padding,
NULL);
- child_allocation.x = GTK_CONTAINER (widget)->border_width + widget->style->xthickness;
- child_allocation.y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ child_allocation.x = border_width + widget->style->xthickness;
+ child_allocation.y = border_width + widget->style->ythickness;
if ((pack_dir == GTK_PACK_DIRECTION_LTR || pack_dir == GTK_PACK_DIRECTION_RTL) &&
(child_pack_dir == GTK_PACK_DIRECTION_LTR || child_pack_dir == GTK_PACK_DIRECTION_RTL))
GtkShadowType shadow_type, selected_shadow_type;
gint width, height;
gint x, y;
- gint border_width = GTK_CONTAINER (widget)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (gtk_widget_is_drawable (widget))
{
GtkDirectionType effective_direction = get_effective_direction (notebook, direction_type);
GtkWidget *toplevel;
- if (GTK_CONTAINER (notebook)->focus_child && effective_direction == GTK_DIR_UP)
+ if (gtk_container_get_focus_child (GTK_CONTAINER (notebook)) && effective_direction == GTK_DIR_UP)
if (focus_tabs_in (notebook))
return;
if (gtk_widget_is_focus (GTK_WIDGET (notebook)) && effective_direction == GTK_DIR_DOWN)
{
GtkNotebookPriv *priv = notebook->priv;
GtkWidget *widget = GTK_WIDGET (notebook);
- gint border_width = GTK_CONTAINER (notebook)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (notebook));
GtkNotebookPage *visible_page = NULL;
GList *tmp_list;
gint tab_pos = get_effective_tab_pos (notebook);
gint arrow_spacing;
gint scroll_arrow_hlength;
gint scroll_arrow_vlength;
+ guint border_width;
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
}
}
- widget->requisition.width += GTK_CONTAINER (widget)->border_width * 2;
- widget->requisition.height += GTK_CONTAINER (widget)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
+ widget->requisition.width += border_width * 2;
+ widget->requisition.height += border_width * 2;
if (switch_page)
{
}
else if (gtk_widget_get_visible (widget))
{
- widget->requisition.width = GTK_CONTAINER (widget)->border_width * 2;
- widget->requisition.height= GTK_CONTAINER (widget)->border_width * 2;
+ widget->requisition.width = border_width * 2;
+ widget->requisition.height= border_width * 2;
}
}
if (vis_pages && !priv->cur_page)
if (priv->children)
{
- gint border_width = GTK_CONTAINER (widget)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
GtkNotebookPage *page;
GtkAllocation child_allocation;
GList *children;
}
widget_is_focus = gtk_widget_is_focus (widget);
- old_focus_child = container->focus_child;
+ old_focus_child = gtk_container_get_focus_child (container);
effective_direction = get_effective_direction (notebook, direction);
gint tab_pos = get_effective_tab_pos (notebook);
widget = GTK_WIDGET (notebook);
- border = GTK_CONTAINER (notebook)->border_width;
+ border = gtk_container_get_border_width (GTK_CONTAINER (notebook));
if (!gtk_widget_get_mapped (widget) || !priv->first_tab)
return;
gboolean showarrow;
gint width, height;
gint x, y;
- gint border_width = GTK_CONTAINER (widget)->border_width;
+ guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gint gap_x = 0, gap_width = 0, step = STEP_PREV;
gboolean is_rtl;
gint tab_pos;
gint scroll_arrow_vlength;
gboolean is_rtl;
gint i;
+ guint border_width;
widget = GTK_WIDGET (notebook);
children = priv->children;
"scroll-arrow-vlength", &scroll_arrow_vlength,
NULL);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (notebook));
+
switch (tab_pos)
{
case GTK_POS_TOP:
case GTK_POS_BOTTOM:
- *min = widget->allocation.x + GTK_CONTAINER (notebook)->border_width;
- *max = widget->allocation.x + widget->allocation.width - GTK_CONTAINER (notebook)->border_width;
+ *min = widget->allocation.x + border_width;
+ *max = widget->allocation.x + widget->allocation.width - border_width;
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
break;
case GTK_POS_RIGHT:
case GTK_POS_LEFT:
- *min = widget->allocation.y + GTK_CONTAINER (notebook)->border_width;
- *max = widget->allocation.y + widget->allocation.height - GTK_CONTAINER (notebook)->border_width;
+ *min = widget->allocation.y + border_width;
+ *max = widget->allocation.y + widget->allocation.height - border_width;
for (i = 0; i < N_ACTION_WIDGETS; i++)
{
gint tab_overlap, tab_pos, tab_extra_space;
gint left_x, right_x, top_y, bottom_y, anchor;
gint xthickness, ythickness;
+ guint border_width;
gboolean gap_left, packing_changed;
GtkAllocation child_allocation = { 0, };
allocate_at_bottom = get_allocate_at_bottom (widget, direction);
anchor = 0;
- child_allocation.x = widget->allocation.x + container->border_width;
- child_allocation.y = widget->allocation.y + container->border_width;
+ border_width = gtk_container_get_border_width (container);
+ child_allocation.x = widget->allocation.x + border_width;
+ child_allocation.y = widget->allocation.y + border_width;
xthickness = widget->style->xthickness;
ythickness = widget->style->ythickness;
{
case GTK_POS_BOTTOM:
child_allocation.y = widget->allocation.y + widget->allocation.height -
- priv->cur_page->requisition.height - container->border_width;
+ priv->cur_page->requisition.height - border_width;
/* fall through */
case GTK_POS_TOP:
child_allocation.x = (allocate_at_bottom) ? max : min;
case GTK_POS_RIGHT:
child_allocation.x = widget->allocation.x + widget->allocation.width -
- priv->cur_page->requisition.width - container->border_width;
+ priv->cur_page->requisition.width - border_width;
/* fall through */
case GTK_POS_LEFT:
child_allocation.y = (allocate_at_bottom) ? max : min;
{
gtk_widget_child_focus (widget, dir);
- if (!GTK_CONTAINER (widget)->focus_child)
+ if (!gtk_container_get_focus_child (GTK_CONTAINER (widget)))
gtk_window_set_focus (GTK_WINDOW (widget), NULL);
}
{
GtkPaned *paned = GTK_PANED (widget);
GtkRequisition child_requisition;
+ guint border_width;
requisition->width = 0;
requisition->height = 0;
}
}
- requisition->width += GTK_CONTAINER (paned)->border_width * 2;
- requisition->height += GTK_CONTAINER (paned)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (paned));
+ requisition->width += border_width * 2;
+ requisition->height += border_width * 2;
if (paned->child1 && gtk_widget_get_visible (paned->child1) &&
paned->child2 && gtk_widget_get_visible (paned->child2))
GtkAllocation *allocation)
{
GtkPaned *paned = GTK_PANED (widget);
- gint border_width = GTK_CONTAINER (paned)->border_width;
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (paned));
widget->allocation = *allocation;
size = pos;
}
- size -= GTK_CONTAINER (paned)->border_width;
+ size -= gtk_container_get_border_width (GTK_CONTAINER (paned));
size = CLAMP (size, paned->min_position, paned->max_position);
GtkWidget *focus_child)
{
GtkPaned *paned;
+ GtkWidget *container_focus_child;
g_return_if_fail (GTK_IS_PANED (container));
for (w = last_focus; w != GTK_WIDGET (paned); w = w->parent)
if (GTK_IS_PANED (w))
last_focus = w;
-
- if (container->focus_child == paned->child1)
+
+ container_focus_child = gtk_container_get_focus_child (container);
+ if (container_focus_child == paned->child1)
gtk_paned_set_last_child1_focus (paned, last_focus);
- else if (container->focus_child == paned->child2)
+ else if (container_focus_child == paned->child2)
gtk_paned_set_last_child2_focus (paned, last_focus);
}
}
{
GtkContainer *container = GTK_CONTAINER (paned);
GtkWidget *ancestor = NULL;
+ GtkWidget *focus_child;
GList *temp_list = NULL;
GList *list;
* paned->last_child?_focus before paned->child?, both when we
* are going forward and backward.
*/
+ focus_child = gtk_container_get_focus_child (container);
if (direction == GTK_DIR_TAB_FORWARD)
{
- if (container->focus_child == paned->child1)
+ if (focus_child == paned->child1)
{
temp_list = g_list_append (temp_list, paned->last_child2_focus);
temp_list = g_list_append (temp_list, paned->child2);
temp_list = g_list_append (temp_list, ancestor);
}
- else if (container->focus_child == paned->child2)
+ else if (focus_child == paned->child2)
{
temp_list = g_list_append (temp_list, ancestor);
temp_list = g_list_append (temp_list, paned->last_child1_focus);
}
else
{
- if (container->focus_child == paned->child1)
+ if (focus_child == paned->child1)
{
temp_list = g_list_append (temp_list, ancestor);
temp_list = g_list_append (temp_list, paned->last_child2_focus);
temp_list = g_list_append (temp_list, paned->child2);
}
- else if (container->focus_child == paned->child2)
+ else if (focus_child == paned->child2)
{
temp_list = g_list_append (temp_list, paned->last_child1_focus);
temp_list = g_list_append (temp_list, paned->child1);
GtkPaned *first;
GtkPaned *prev, *next;
GtkWidget *toplevel;
+ GtkWidget *focus_child;
gtk_paned_find_neighbours (paned, &next, &prev);
+ focus_child = gtk_container_get_focus_child (container);
- if (container->focus_child == paned->child1)
+ if (focus_child == paned->child1)
{
if (reversed)
{
first = paned;
}
}
- else if (container->focus_child == paned->child2)
+ else if (focus_child == paned->child2)
{
if (reversed)
{
GtkPathBar *path_bar;
GtkRequisition child_requisition;
GList *list;
+ guint border_width;
path_bar = GTK_PATH_BAR (widget);
gtk_widget_size_request (path_bar->up_slider_button, &child_requisition);
gtk_widget_size_request (path_bar->down_slider_button, &child_requisition);
- requisition->width += GTK_CONTAINER (widget)->border_width * 2;
- requisition->height += GTK_CONTAINER (widget)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width += border_width * 2;
+ requisition->height += border_width * 2;
widget->requisition = *requisition;
}
GList *list, *first_button;
gint width;
gint allocation_width;
- gint border_width;
+ guint border_width;
gboolean need_sliders = FALSE;
gint up_slider_offset = 0;
GtkRequisition child_requisition;
return;
direction = gtk_widget_get_direction (widget);
- border_width = (gint) GTK_CONTAINER (path_bar)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (path_bar));
allocation_width = allocation->width - 2 * border_width;
/* First, we check to see if we need the scrollbars. */
}
space_available = (GTK_WIDGET (path_bar)->allocation.width
- - 2 * GTK_CONTAINER (path_bar)->border_width
+ - 2 * gtk_container_get_border_width (GTK_CONTAINER (path_bar))
- 2 * path_bar->spacing - 2 * path_bar->slider_width
- BUTTON_DATA (down_button->data)->button->allocation.width);
path_bar->first_scrolled_button = down_button;
{
GtkAllocation child_allocation;
- child_allocation.x = child_allocation.y = GTK_CONTAINER (widget)->border_width;
+ child_allocation.x = child_allocation.y = gtk_container_get_border_width (GTK_CONTAINER (widget));
child_allocation.width =
MAX (1, (gint)allocation->width - child_allocation.x * 2);
child_allocation.height =
GtkPlug *plug = GTK_PLUG (widget);
GtkWindow *window = GTK_WINDOW (widget);
GtkContainer *container = GTK_CONTAINER (widget);
- GtkWidget *old_focus_child = container->focus_child;
+ GtkWidget *old_focus_child;
GtkWidget *parent;
-
+
+ old_focus_child = gtk_container_get_focus_child (container);
/* We override GtkWindow's behavior, since we don't want wrapping here.
*/
if (old_focus_child)
return TRUE;
}
- if (!GTK_CONTAINER (window)->focus_child)
+ if (!gtk_container_get_focus_child (GTK_CONTAINER (window)))
_gtk_plug_windowing_focus_to_parent (plug, direction);
return FALSE;
gint indicator_size, indicator_spacing;
gint focus_width;
gint focus_pad;
+ guint border_width;
gboolean interior_focus;
widget = GTK_WIDGET (check_button);
button = GTK_BUTTON (check_button);
toggle_button = GTK_TOGGLE_BUTTON (check_button);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
gtk_widget_style_get (widget,
"interior-focus", &interior_focus,
"focus-line-width", &focus_width,
_gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
- x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width;
+ x = widget->allocation.x + indicator_spacing + border_width;
y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
child = GTK_BIN (check_button)->child;
GdkRectangle restrict_area;
GdkRectangle new_area;
- restrict_area.x = widget->allocation.x + GTK_CONTAINER (widget)->border_width;
- restrict_area.y = widget->allocation.y + GTK_CONTAINER (widget)->border_width;
- restrict_area.width = widget->allocation.width - (2 * GTK_CONTAINER (widget)->border_width);
- restrict_area.height = widget->allocation.height - (2 * GTK_CONTAINER (widget)->border_width);
+ restrict_area.x = widget->allocation.x + border_width;
+ restrict_area.y = widget->allocation.y + border_width;
+ restrict_area.width = widget->allocation.width - (2 * border_width);
+ restrict_area.height = widget->allocation.height - (2 * border_width);
if (gdk_rectangle_intersect (area, &restrict_area, &new_area))
{
else
{
GtkContainer *container = GTK_CONTAINER (widget);
+ guint border_width;
- relative_allocation.x = container->border_width;
- relative_allocation.y = container->border_width;
- relative_allocation.width = widget->allocation.width - 2 * container->border_width;
- relative_allocation.height = widget->allocation.height - 2 * container->border_width;
+ border_width = gtk_container_get_border_width (container);
+
+ relative_allocation.x = border_width;
+ relative_allocation.y = border_width;
+ relative_allocation.width = widget->allocation.width - 2 * border_width;
+ relative_allocation.height = widget->allocation.height - 2 * border_width;
}
gtk_paint_shadow (widget->style, widget->window,
GtkScrolledWindow *scrolled_window;
GtkScrolledWindowPrivate *priv;
gint scrollbar_spacing;
+ guint border_width;
g_return_if_fail (widget != NULL);
g_return_if_fail (allocation != NULL);
priv = GTK_SCROLLED_WINDOW_GET_PRIVATE (scrolled_window);
- allocation->x = GTK_CONTAINER (widget)->border_width;
- allocation->y = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ allocation->x = border_width;
+ allocation->y = border_width;
if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
{
GtkAllocation child_allocation;
gboolean scrollbars_within_bevel;
gint scrollbar_spacing;
+ guint border_width;
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (widget));
g_return_if_fail (allocation != NULL);
priv = GTK_SCROLLED_WINDOW_GET_PRIVATE (scrolled_window);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (scrolled_window));
widget->allocation = *allocation;
if (scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS)
(scrolled_window->shadow_type == GTK_SHADOW_NONE ?
0 : widget->style->ythickness));
else
- child_allocation.y = GTK_CONTAINER (scrolled_window)->border_width;
+ child_allocation.y = border_width;
child_allocation.width = relative_allocation.width;
child_allocation.height = hscrollbar_requisition.height;
(scrolled_window->shadow_type == GTK_SHADOW_NONE ?
0 : widget->style->xthickness));
else
- child_allocation.x = GTK_CONTAINER (scrolled_window)->border_width;
+ child_allocation.x = border_width;
child_allocation.y = relative_allocation.y;
child_allocation.width = vscrollbar_requisition.width;
GtkDirectionType direction)
{
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (widget);
- gboolean had_focus_child = GTK_CONTAINER (widget)->focus_child != NULL;
+ gboolean had_focus_child;
+
+ had_focus_child = gtk_container_get_focus_child (GTK_CONTAINER (widget)) != NULL;
if (scrolled_window->focus_out)
{
GtkRequisition vscrollbar_requisition;
GtkRequisition minimum_req, natural_req;
gint min_child_size, nat_child_size;
+ guint border_width;
scrolled_window = GTK_SCROLLED_WINDOW (widget);
bin = GTK_BIN (scrolled_window);
extra_width = scrollbar_spacing + vscrollbar_requisition.width;
}
- minimum_req.width += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_width);
- minimum_req.height += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_height);
- natural_req.width += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_width);
- natural_req.height += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_height);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ minimum_req.width += border_width * 2 + MAX (0, extra_width);
+ minimum_req.height += border_width * 2 + MAX (0, extra_height);
+ natural_req.width += border_width * 2 + MAX (0, extra_width);
+ natural_req.height += border_width * 2 + MAX (0, extra_height);
if (scrolled_window->shadow_type != GTK_SHADOW_NONE)
{
/* This is a copy of gtk_window_focus(), modified so that we
* can detect wrap-around.
*/
- old_focus_child = container->focus_child;
+ old_focus_child = gtk_container_get_focus_child (container);
if (old_focus_child)
{
static gboolean
has_extra_children (GtkStatusbar *statusbar)
{
- GList *l;
+ GList *l, *children;
GtkBoxChild *child, *frame;
/* If the internal frame has been modified assume we have extra children */
return TRUE;
frame = NULL;
- for (l = gtk_container_get_children (GTK_CONTAINER (statusbar)); l; l = l->next)
+ children = gtk_container_get_children (GTK_CONTAINER (statusbar));
+ for (l = children; l; l = l->next)
{
frame = l->data;
return TRUE;
}
+ g_list_free (children);
+
return FALSE;
}
{
GtkTable *table = GTK_TABLE (widget);
gint row, col;
+ guint border_width;
requisition->width = 0;
requisition->height = 0;
requisition->height += table->rows[row].requisition;
for (row = 0; row + 1 < table->nrows; row++)
requisition->height += table->rows[row].spacing;
-
- requisition->width += GTK_CONTAINER (table)->border_width * 2;
- requisition->height += GTK_CONTAINER (table)->border_width * 2;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
+ requisition->width += border_width * 2;
+ requisition->height += border_width * 2;
}
static void
gint nexpand;
gint nshrink;
gint extra;
-
+ guint border_width;
+
/* If we were allocated more space than we requested
* then we have to expand any expandable rows and columns
* to fill in the extra space.
*/
-
- real_width = GTK_WIDGET (table)->allocation.width - GTK_CONTAINER (table)->border_width * 2;
- real_height = GTK_WIDGET (table)->allocation.height - GTK_CONTAINER (table)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
+ real_width = GTK_WIDGET (table)->allocation.width - border_width * 2;
+ real_height = GTK_WIDGET (table)->allocation.height - border_width * 2;
if (table->homogeneous)
{
if (gtk_widget_get_visible (child->widget))
{
GtkRequisition child_requisition;
+ guint border_width;
+
gtk_widget_get_child_requisition (child->widget, &child_requisition);
- x = GTK_WIDGET (table)->allocation.x + GTK_CONTAINER (table)->border_width;
- y = GTK_WIDGET (table)->allocation.y + GTK_CONTAINER (table)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (table));
+ x = GTK_WIDGET (table)->allocation.x + border_width;
+ y = GTK_WIDGET (table)->allocation.y + border_width;
max_width = 0;
max_height = 0;
gtk_tearoff_menu_item_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
- requisition->width = (GTK_CONTAINER (widget)->border_width +
- widget->style->xthickness +
- BORDER_SPACING) * 2;
- requisition->height = (GTK_CONTAINER (widget)->border_width +
- widget->style->ythickness) * 2;
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = (border_width + widget->style->xthickness + BORDER_SPACING) * 2;
+ requisition->height = (border_width + widget->style->ythickness) * 2;
if (GTK_IS_MENU (widget->parent) && GTK_MENU (widget->parent)->torn_off)
{
gint width, height;
gint x, y;
gint right_max;
+ guint border_width;
GtkArrowType arrow_type;
GtkTextDirection direction;
direction = gtk_widget_get_direction (widget);
- x = widget->allocation.x + GTK_CONTAINER (menu_item)->border_width;
- y = widget->allocation.y + GTK_CONTAINER (menu_item)->border_width;
- width = widget->allocation.width - GTK_CONTAINER (menu_item)->border_width * 2;
- height = widget->allocation.height - GTK_CONTAINER (menu_item)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (menu_item));
+ x = widget->allocation.x + border_width;
+ y = widget->allocation.y + border_width;
+ width = widget->allocation.width - border_width * 2;
+ height = widget->allocation.height - border_width * 2;
right_max = x + width;
if (widget->state == GTK_STATE_PRELIGHT)
GSList *tmp_list;
gint focus_edge_width;
gint focus_width;
+ guint border_width;
gboolean interior_focus;
text_view = GTK_TEXT_VIEW (widget);
if (priv->bottom_window)
requisition->height += priv->bottom_window->requisition.height;
- requisition->width += GTK_CONTAINER (text_view)->border_width * 2;
- requisition->height += GTK_CONTAINER (text_view)->border_width * 2;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (text_view));
+ requisition->width += border_width * 2;
+ requisition->height += border_width * 2;
tmp_list = priv->children;
while (tmp_list != NULL)
GdkRectangle bottom_rect;
gint focus_edge_width;
gint focus_width;
+ guint border_width;
gboolean interior_focus;
gboolean size_changed;
size_changed =
widget->allocation.width != allocation->width ||
widget->allocation.height != allocation->height;
-
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (text_view));
+
widget->allocation = *allocation;
if (gtk_widget_get_realized (widget))
else
focus_edge_width = focus_width;
- width = allocation->width - focus_edge_width * 2 - GTK_CONTAINER (text_view)->border_width * 2;
+ width = allocation->width - focus_edge_width * 2 - border_width * 2;
if (priv->left_window)
left_rect.width = priv->left_window->requisition.width;
bottom_rect.width = text_rect.width;
- height = allocation->height - focus_edge_width * 2 - GTK_CONTAINER (text_view)->border_width * 2;
+ height = allocation->height - focus_edge_width * 2 - border_width * 2;
if (priv->top_window)
top_rect.height = priv->top_window->requisition.height;
right_rect.height = text_rect.height;
/* Origins */
- left_rect.x = focus_edge_width + GTK_CONTAINER (text_view)->border_width;
- top_rect.y = focus_edge_width + GTK_CONTAINER (text_view)->border_width;
+ left_rect.x = focus_edge_width + border_width;
+ top_rect.y = focus_edge_width + border_width;
text_rect.x = left_rect.x + left_rect.width;
text_rect.y = top_rect.y + top_rect.height;
container = GTK_CONTAINER (widget);
if (!gtk_widget_is_focus (widget) &&
- container->focus_child == NULL)
+ gtk_container_get_focus_child (container) == NULL)
{
gtk_widget_grab_focus (widget);
return TRUE;
{
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
-
+
GdkWindowAttr attributes;
gint attributes_mask;
- gint border_width;
-
+ guint border_width;
+
gtk_widget_set_realized (widget, TRUE);
-
- border_width = GTK_CONTAINER (widget)->border_width;
-
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
attributes.wclass = GDK_INPUT_ONLY;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x + border_width;
GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
GList *list;
- gint border_width;
-
- border_width = GTK_CONTAINER (widget)->border_width;
-
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
if (gtk_widget_is_drawable (widget))
{
gtk_paint_box (widget->style,
gint long_req;
gint pack_front_size;
gint ipadding;
+ guint border_width;
GtkRequisition arrow_requisition;
max_homogeneous_child_width = 0;
/* Extra spacing */
ipadding = get_internal_padding (toolbar);
-
- requisition->width += 2 * (ipadding + GTK_CONTAINER (toolbar)->border_width);
- requisition->height += 2 * (ipadding + GTK_CONTAINER (toolbar)->border_width);
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (toolbar));
+ requisition->width += 2 * (ipadding + border_width);
+ requisition->height += 2 * (ipadding + border_width);
if (get_shadow_type (toolbar) != GTK_SHADOW_NONE)
{
rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
vertical = (toolbar->orientation == GTK_ORIENTATION_VERTICAL);
- border_width = get_internal_padding (toolbar) + GTK_CONTAINER (toolbar)->border_width;
+ border_width = get_internal_padding (toolbar) + gtk_container_get_border_width (GTK_CONTAINER (toolbar));
if (rtl)
{
gtk_toolbar_stop_sliding (toolbar);
widget->allocation = *allocation;
-
- border_width = GTK_CONTAINER (toolbar)->border_width;
-
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (toolbar));
+
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (priv->event_window,
for (list = children; list != NULL; list = list->next)
{
GtkWidget *child = list->data;
-
- if (GTK_CONTAINER (toolbar)->focus_child == child)
+
+ if (gtk_container_get_focus_child (GTK_CONTAINER (toolbar)) == child)
break;
if (gtk_widget_get_mapped (child) && gtk_widget_child_focus (child, dir))
{
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
GtkContainer *container = GTK_CONTAINER (toolbar);
+ GtkWidget *focus_child;
GList *list;
gboolean try_focus = FALSE;
GList *children;
- if (container->focus_child &&
- gtk_widget_child_focus (container->focus_child, dir))
- {
- return;
- }
+ focus_child = gtk_container_get_focus_child (container);
+
+ if (focus_child && gtk_widget_child_focus (focus_child, dir))
+ return;
children = gtk_toolbar_list_children_in_focus_order (toolbar, dir);
if (try_focus && gtk_widget_get_mapped (child) && gtk_widget_child_focus (child, dir))
break;
- if (child == GTK_CONTAINER (toolbar)->focus_child)
+ if (child == focus_child)
try_focus = TRUE;
}
* arrow keys or Ctrl TAB (both of which are handled by the
* gtk_toolbar_move_focus() keybinding function.
*/
- if (GTK_CONTAINER (widget)->focus_child)
+ if (gtk_container_get_focus_child (GTK_CONTAINER (widget)))
return FALSE;
children = gtk_toolbar_list_children_in_focus_order (toolbar, dir);
g_return_if_fail (toolitem->priv->use_drag_window == TRUE);
widget = GTK_WIDGET (toolitem);
- border_width = GTK_CONTAINER (toolitem)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x + border_width;
GtkRequisition *requisition)
{
GtkWidget *child = GTK_BIN (widget)->child;
+ guint border_width;
if (child && gtk_widget_get_visible (child))
{
requisition->height = 0;
requisition->width = 0;
}
-
- requisition->width += (GTK_CONTAINER (widget)->border_width) * 2;
- requisition->height += (GTK_CONTAINER (widget)->border_width) * 2;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width += border_width * 2;
+ requisition->height += border_width * 2;
}
static void
GtkWidget *child = GTK_BIN (widget)->child;
widget->allocation = *allocation;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (toolitem->priv->drag_window)
gdk_window_move_resize (toolitem->priv->drag_window,
gtk_tool_item_group_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
- const gint border_width = GTK_CONTAINER (widget)->border_width;
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (widget);
GtkToolItemGroupPrivate* priv = group->priv;
GtkOrientation orientation;
GtkRequisition item_size;
gint requested_rows;
+ guint border_width;
if (priv->children && gtk_tool_item_group_get_label_widget (group))
{
else
requisition->height = MAX (requisition->height, item_size.height * requested_rows);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width += border_width * 2;
requisition->height += border_width * 2;
}
GtkAllocation *allocation,
GtkRequisition *inquery)
{
- const gint border_width = GTK_CONTAINER (widget)->border_width;
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (widget);
GtkToolItemGroupPrivate* priv = group->priv;
GtkToolbarStyle style;
gint min_rows;
+ guint border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
orientation = gtk_tool_shell_get_orientation (GTK_TOOL_SHELL (group));
style = gtk_tool_shell_get_style (GTK_TOOL_SHELL (group));
gtk_tool_item_group_real_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- const gint border_width = GTK_CONTAINER (widget)->border_width;
GtkToolItemGroup *group = GTK_TOOL_ITEM_GROUP (widget);
GtkToolItemGroupPrivate* priv = group->priv;
GtkRequisition child_requisition;
gint n_columns, n_rows = 1;
gint min_rows;
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
GtkTextDirection direction = gtk_widget_get_direction (widget);
gtk_tool_item_group_realize (GtkWidget *widget)
{
GtkWidget *toplevel_window;
- const gint border_width = GTK_CONTAINER (widget)->border_width;
gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
GdkWindowAttr attributes;
GdkDisplay *display;
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x + border_width;
gtk_tool_palette_size_request (GtkWidget *widget,
GtkRequisition *requisition)
{
- const gint border_width = GTK_CONTAINER (widget)->border_width;
GtkToolPalette *palette = GTK_TOOL_PALETTE (widget);
GtkRequisition child_requisition;
+ guint border_width;
guint i;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
requisition->width = 0;
requisition->height = 0;
gtk_tool_palette_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
- const gint border_width = GTK_CONTAINER (widget)->border_width;
GtkToolPalette *palette = GTK_TOOL_PALETTE (widget);
GtkAdjustment *adjustment = NULL;
GtkAllocation child_allocation;
gint page_start, page_size = 0;
gint offset = 0;
guint i;
+ guint border_width;
gint min_offset = -1, max_offset = -1;
gint *group_sizes = g_newa (gint, palette->priv->groups->len);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
GtkTextDirection direction = gtk_widget_get_direction (widget);
GTK_WIDGET_CLASS (gtk_tool_palette_parent_class)->size_allocate (widget, allocation);
static void
gtk_tool_palette_realize (GtkWidget *widget)
{
- const gint border_width = GTK_CONTAINER (widget)->border_width;
- gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
GdkWindowAttr attributes;
+ gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x + border_width;
if (GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->expose_event)
retval = GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->expose_event (widget, event);
- focus_child = GTK_CONTAINER (widget)->focus_child;
+ focus_child = gtk_container_get_focus_child (GTK_CONTAINER (widget));
if (focus_child && gtk_widget_has_focus (focus_child))
{
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
x = widget->allocation.x + border_width;
y = widget->allocation.y + border_width;
if (! GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_HEADERS_VISIBLE))
return FALSE;
- focus_child = GTK_CONTAINER (tree_view)->focus_child;
+ focus_child = gtk_container_get_focus_child (GTK_CONTAINER (tree_view));
first_column = tree_view->priv->columns;
while (first_column)
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_can_focus (widget))
return FALSE;
- focus_child = container->focus_child;
+ focus_child = gtk_container_get_focus_child (container);
gtk_tree_view_stop_editing (GTK_TREE_VIEW (widget), FALSE);
/* Case 1. Headers currently have focus. */
{
GtkWidget *widget = GTK_WIDGET (viewport);
GtkAllocation *allocation = &widget->allocation;
- gint border_width = GTK_CONTAINER (viewport)->border_width;
-
+ guint border_width;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (viewport));
+
view_allocation->x = 0;
view_allocation->y = 0;
GtkBin *bin = GTK_BIN (widget);
GtkAdjustment *hadjustment = gtk_viewport_get_hadjustment (viewport);
GtkAdjustment *vadjustment = gtk_viewport_get_vadjustment (viewport);
- gint border_width = GTK_CONTAINER (widget)->border_width;
-
+ guint border_width;
+
GtkAllocation view_allocation;
GdkWindowAttr attributes;
gint attributes_mask;
gint event_mask;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
gtk_widget_set_realized (widget, TRUE);
attributes.x = widget->allocation.x + border_width;
{
GtkViewport *viewport = GTK_VIEWPORT (widget);
GtkBin *bin = GTK_BIN (widget);
- gint border_width = GTK_CONTAINER (widget)->border_width;
+ guint border_width;
gboolean hadjustment_value_changed, vadjustment_value_changed;
GtkAdjustment *hadjustment = gtk_viewport_get_hadjustment (viewport);
GtkAdjustment *vadjustment = gtk_viewport_get_vadjustment (viewport);
GtkAllocation child_allocation;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
/* If our size changed, and we have a shadow, queue a redraw on widget->window to
* redraw the shadow correctly.
*/
/* XXX This should probably be (border_width * 2); but GTK+ has
* been doing this with a single border for a while now...
*/
- minimum = GTK_CONTAINER (widget)->border_width;
+ minimum = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (GTK_VIEWPORT (widget)->shadow_type != GTK_SHADOW_NONE)
{
if (gtk_widget_is_toplevel (toplevel))
_gtk_window_unset_focus_and_default (GTK_WINDOW (toplevel), widget);
- if (GTK_CONTAINER (widget->parent)->focus_child == widget)
+ if (gtk_container_get_focus_child (GTK_CONTAINER (widget->parent)) == widget)
gtk_container_set_focus_child (GTK_CONTAINER (widget->parent), NULL);
/* If we are unanchoring the child, we save around the toplevel
gboolean need_resize;
GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
-
+
need_resize = container->need_resize || !gtk_widget_get_realized (widget);
container->need_resize = FALSE;
{
GtkWindow *window;
GtkAllocation child_allocation;
+ guint border_width;
window = GTK_WINDOW (widget);
widget->allocation = *allocation;
if (window->bin.child && gtk_widget_get_visible (window->bin.child))
{
- child_allocation.x = GTK_CONTAINER (window)->border_width;
- child_allocation.y = GTK_CONTAINER (window)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (window));
+ child_allocation.x = border_width;
+ child_allocation.y = border_width;
child_allocation.width =
MAX (1, (gint)allocation->width - child_allocation.x * 2);
child_allocation.height =
{
gtk_widget_child_focus (GTK_WIDGET (window), dir);
- if (!GTK_CONTAINER (window)->focus_child)
+ if (!gtk_container_get_focus_child (GTK_CONTAINER (window)))
gtk_window_set_focus (window, NULL);
}
window = GTK_WINDOW (widget);
bin = GTK_BIN (widget);
- old_focus_child = container->focus_child;
+ old_focus_child = gtk_container_get_focus_child (container);
/* We need a special implementation here to deal properly with wrapping
* around in the tab chain without the danger of going into an
{
GtkWindow *window;
GtkWidget *child;
+ guint border_width;
window = GTK_WINDOW (widget);
child = gtk_bin_get_child (GTK_BIN (window));
-
- *minimum_size = GTK_CONTAINER (window)->border_width * 2;
- *natural_size = GTK_CONTAINER (window)->border_width * 2;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (window));
+ *minimum_size = border_width * 2;
+ *natural_size = border_width * 2;
if (child && gtk_widget_get_visible (child))
{
{
GtkWindow *window;
GtkWidget *child;
+ guint border_width;
window = GTK_WINDOW (widget);
child = gtk_bin_get_child (GTK_BIN (window));
-
- *minimum_size = GTK_CONTAINER (window)->border_width * 2;
- *natural_size = GTK_CONTAINER (window)->border_width * 2;
+
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (window));
+ *minimum_size = border_width * 2;
+ *natural_size = border_width * 2;
if (child && gtk_widget_get_visible (child))
{
g_object_ref (window);
g_object_ref (widget);
- if (GTK_CONTAINER (widget->parent)->focus_child == widget)
+ if (gtk_container_get_focus_child (GTK_CONTAINER (widget->parent)) == widget)
{
child = window->focus_widget;
gdk_window_process_updates (widget->window, TRUE);
- if (container->resize_mode == GTK_RESIZE_QUEUE)
+ if (gtk_container_get_resize_mode (container) == GTK_RESIZE_QUEUE)
gtk_widget_queue_draw (widget);
}
else
* FIXME: we should also dequeue the pending redraws here, since
* we handle those ourselves upon ->configure_notify_received==TRUE.
*/
- if (container->resize_mode == GTK_RESIZE_QUEUE)
+ if (gtk_container_get_resize_mode (container) == GTK_RESIZE_QUEUE)
{
gtk_widget_queue_resize_no_redraw (widget);
_gtk_container_dequeue_resize_handler (container);
g_assert (vbox != NULL);
g_assert (GTK_IS_VBOX (vbox));
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_WIDGET (vbox)->parent)), "dialog1") == 0);
- g_assert (GTK_CONTAINER (vbox)->border_width == 10);
+ g_assert (gtk_container_get_border_width (GTK_CONTAINER (vbox)) == 10);
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->vbox)), "dialog1-vbox") == 0);
action_area = gtk_builder_get_object (builder, "dialog1-action_area");
g_assert (action_area != NULL);
g_assert (GTK_IS_HBUTTON_BOX (action_area));
g_assert (GTK_WIDGET (action_area)->parent != NULL);
- g_assert (GTK_CONTAINER (action_area)->border_width == 20);
+ g_assert (gtk_container_get_border_width (GTK_CONTAINER (action_area)) == 20);
g_assert (GTK_DIALOG (dialog)->action_area != NULL);
g_assert (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->action_area)) != NULL);
g_assert (strcmp (gtk_buildable_get_name (GTK_BUILDABLE (GTK_DIALOG (dialog)->action_area)), "dialog1-action_area") == 0);
GtkOffscreenBox *offscreen_box = GTK_OFFSCREEN_BOX (widget);
GdkWindowAttr attributes;
gint attributes_mask;
- gint border_width;
+ guint border_width;
GtkRequisition child_requisition;
int start_y = 0;
gtk_widget_set_realized (widget, TRUE);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
{
GtkOffscreenBox *offscreen_box = GTK_OFFSCREEN_BOX (widget);
int w, h;
+ guint border_width;
w = 0;
h = 0;
h += CHILD2_SIZE_SCALE * child_requisition.height;
}
- requisition->width = GTK_CONTAINER (widget)->border_width * 2 + w;
- requisition->height = GTK_CONTAINER (widget)->border_width * 2 + h;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = border_width * 2 + w;
+ requisition->height = border_width * 2 + h;
}
static void
GtkAllocation *allocation)
{
GtkOffscreenBox *offscreen_box;
- gint border_width;
gint start_y;
+ guint border_width;
widget->allocation = *allocation;
offscreen_box = GTK_OFFSCREEN_BOX (widget);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (widget->window,